package com.bamboocloud.im.simpleConnector.simpleConnector.utils;

/**
 * 根据字符获取类型的类
 */
public class TypeCastUtil {

     public static Class<?> getAttrTypeByName(String typeName){
         if("double".equals(typeName) || "Double".equals(typeName) || "DOUBLE".equals(typeName)){
             return Double.class;
         }
        if("float".equals(typeName) || "Float".equals(typeName) || "FLOAT".equals(typeName)){
            return  Float.class;
        }
        if("int".equals(typeName) || "Int".equals(typeName) || "Integer".equals(typeName)){
            return  Integer.class;
        }
        if("long".equals(typeName) || "Long".equals(typeName) || "LONG".equals(typeName)){
            return  Long.class;
        }
        if("byte".equals(typeName) || "Byte".equals(typeName) || "BYTE".equals(typeName)){
            return  Byte.class;
        }
        if("short".equals(typeName) || "Short".equals(typeName) || "SHORT".equals(typeName)){
            return Short.class;
        }
        if("string".equals(typeName) || "String".equals(typeName) || "STRING".equals(typeName)){
            return  String.class;
        }
        if("boolean".equals(typeName) || "Boolean".equals(typeName) || "BOOLEAN".equals(typeName)){
            return Boolean.class;
        }
         return null;
    }
}
